function f1(form)
{
 if(form.t1.value=="")
 {
  alert("Please enter the date");
  form.t1.focus();  
  return false;
 }
 if(form.t2.value=="")
 {
  alert("Please enter the month");
  form.t2.focus();  
  return false;
 }
 if(form.t3.value=="")
 {
  alert("Please enter the year");
  form.t3.focus();  
  return false;
 }
 
 var z1="";
 z1=form.t1.value;
 for(var i=0;i<z1.length;i++)
 {
  var j1=z1.charCodeAt(i);
  if((j1>=48)&(j1<=57))
  {
  }
  else 
  {
   alert("Date should be in digits only");
   form.t1.value="";
   form.t1.focus();  
   return false;
  }
 }
 if(form.t1.value <= 0 || form.t1.value > 31)
 {
  alert("Enter the correct date");
  form.t1.value="";
  form.t1.focus();  
  return false;  
 }
 
 var z2="";
 z2=form.t2.value;
 for(var i=0;i<z2.length;i++)
 {
  var j2=z2.charCodeAt(i);
  if((j2>=48)&(j2<=57))
  {
  }
  else 
  {
   alert("Month should be in digits only");
     form.t2.value="";
   form.t2.focus();  
   return false;
  }
 }
 if(form.t2.value <= 0 || form.t2.value > 12)
 {
  alert("Enter the correct month");
  form.t2.value="";
  form.t2.focus();  
  return false;  
 }
 
 var z3="";
 z3=form.t3.value;
 for(var i=0;i<z3.length;i++)
 {
  var j3=z3.charCodeAt(i);
  if((j3>=48)&(j3<=57))
  {
  }
  else 
  {
   alert("Year should be in digits only");
      form.t3.value="";
   form.t3.focus();  
   return false;
  }
 } 
 if(z3.length<4|z3.length>4)
 {
  alert("Enter the correct year");
  form.t3.value="";
  form.t3.focus();
  return false
 }
 //if(form.t3.value<1800|form.t3.value>2002)
 //{
  //alert("Enter the year between 1800 & 2002");
  //form.t3.value="";
  //form.t3.focus();
  //return false;
 //}
 
 var a=form.t1.value;
 var b=a%9;
 form.t4.value=b;
 if(b==0)
 {
  form.t4.value=9;
 }  
 var c=form.t1.value;
 var d=form.t2.value; 
 var e=form.t3.value;
 var f=eval(c)+eval(d)+eval(e);
 var g=f%9;
 form.t5.value=g;
 if(g==0)
 {
  form.t5.value=9;
 }
}
 
function f2(form)
{
 form.t1.value="";
 form.t2.value="";
 form.t3.value="";
 form.t4.value="";
 form.t5.value="";
 form.t1.focus();  
}